using ASP;
using HoWave.Common;
using HoWave.Web;
using HoWave.Web.Shop;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
public class Vertical_Specail : Shop, IRequiresSessionState
{
	protected int SpecialID = 0;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Init(object sender, EventArgs e)
	{
		this.SpecialID = Fetch.GetID("ID");
		if (Fetch.GetID("ID") <= 0)
		{
			this.WriteErrMsg("", Language.Get("Common/LostParam"), "");
		}
		SpecialBll specialBll = new SpecialBll(this.conn);
		DataTable specialByID = specialBll.GetSpecialByID(this.SpecialID);
		if (specialByID.Rows.Count > 0)
		{
			if (specialByID.Rows[0]["Template"] != null && specialByID.Rows[0]["Template"].ToString().Length > 0)
			{
				string template = Template.GetTemplate(this.config["TemplateDir"].ToString() + "\\" + specialByID.Rows[0]["Template"].ToString());
				Template.BindTextToPage(this.Page, template);
			}
			else
			{
				Template.BindTemplateToPage(this.Page, "SpecialDefault");
			}
		}
		else
		{
			this.WriteErrMsg("", Language.Get("Common/NotData"), "");
		}
		string a = "";
		int num = Convert.ToInt32(specialByID.Rows[0]["SkinID"]);
		SkinBll skinBll = new SkinBll(this.conn);
		if (num > 0)
		{
			DataTable skinBySkinID = skinBll.GetSkinBySkinID(num);
			if (skinBySkinID.Rows.Count > 0)
			{
				if (skinBySkinID.Rows[0]["SkinPath"].IsNull(new object[0]) != null && skinBySkinID.Rows[0]["SkinPath"].IsNull(new object[0]) != "")
				{
					a = skinBySkinID.Rows[0]["SkinPath"].ToString();
				}
			}
		}
		else
		{
			if (num == -1)
			{
				DataTable defaultBySkinType = skinBll.GetDefaultBySkinType("Special");
				if (defaultBySkinType.Rows.Count > 0)
				{
					if (defaultBySkinType.Rows[0]["SkinPath"].IsNull(new object[0]) != "" || defaultBySkinType.Rows[0]["SkinPath"] != null)
					{
						a = defaultBySkinType.Rows[0]["SkinPath"].ToString();
					}
				}
			}
		}
		if (a != "")
		{
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		HtmlMeta htmlMeta = new HtmlMeta();
		HtmlMeta htmlMeta2 = new HtmlMeta();
		htmlMeta.Name = "keywords";
		htmlMeta.Content = this.config["MetaKeywords"].ToString();
		htmlMeta2.Name = "description";
		htmlMeta2.Content = this.config["MetaDescription"].ToString();
		try
		{
			this.Page.Title = this.config["SiteName"].ToString() + "&nbsp;" + this.config["otherTitle"].ToString();
		}
		catch
		{
		}
		try
		{
			this.Page.Header.Controls.Add(htmlMeta);
		}
		catch
		{
		}
		try
		{
			this.Page.Header.Controls.Add(htmlMeta2);
		}
		catch
		{
		}
	}
}
